import pandas as pd
import requests

import matplotlib.pyplot as plt
r = requests.get('http://127.0.0.1:8000/fof/e818d701-71be-11ec-b898-c858c0412ade')
df = pd.DataFrame(r.json())
print(df)
df.index = df['date']
df['equity'] = (df['portfolio'].pct_change() + 1).cumprod()

from engine.performance import PerformanceUtils
ret = PerformanceUtils().calc_equity(df[['equity']])
print(ret)
df['equity'].plot()
plt.show()